﻿using System;

namespace Core.Library
{
    public class UploadUtils
    {
        public const long AvatarUploadMaxSize = 2097152;
        public const int AvatarMaxWidth = 4800;
        public const int AvatarMaxHeight = 3600;
        public const int AvatarMinWidth = 220;
        public const int AvatarMinHeight = 330;
        public const int AvatarThumbWith = 600;
        public const int ImageMinWidth = 600;
        public const long ImagesUploadMaxSize = 2097152;
        public const int TimeExpire = 60;
        public const int ImagesUploadMaxItems = 31;

        public static string GenerateUserImagesFileName(string extention)
        {
            const string format = "yyyyMMddHHmmssFFFF";
            return DateTime.Now.ToString(format) + extention;
        }

        public static string GenerateUserImagesFolder(int id)
        {
            return "/event/stylist/userimages/" + id + "/";
        }

        public static string CutImageName(string path)
        {
            return path.Substring(path.LastIndexOf("/") + 1, path.Length - path.LastIndexOf("/") -1);
        }
    }

}